package com.example.shushiyunsst.util

import android.content.ClipData
import android.content.ClipboardManager
import android.content.Context
import android.widget.Toast
import com.example.library_common.global.AppGlobals

/**
 * 复制字符串
 * */
fun clipboard(lab: String, content: String) {
    val clipboardManager: ClipboardManager =
        AppGlobals.getApplication().getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
    val clipData = ClipData.newPlainText(lab, content)
    clipboardManager.setPrimaryClip(clipData)

    Toast.makeText( AppGlobals.getApplication(), "复制成功", Toast.LENGTH_SHORT).show()
}